﻿<UserControl x:Class="Real.Silverlight.TestApp.MainPage"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:Real_Controls="clr-namespace:Real.Silverlight.Controls;assembly=Real.Silverlight.Controls"
             d:DesignHeight="300"
             d:DesignWidth="600"
             mc:Ignorable="d">

    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <Real_Controls:SwitchButton Margin="20" Foreground="Yellow" />

        <Real_Controls:DatePicker Grid.Column="1"
                                  Height="30"
                                  Margin="20"
                                  SelectedDate="{Binding TestDate,
                                                         Mode=TwoWay}"
                                  ValidationErrorMessage="Not a valid date" />

        <TextBlock Grid.Column="3"
                   Margin="20"
                   VerticalAlignment="Center"
                   Text="{Binding TestDate,
                                  StringFormat=d}" />

        <Real_Controls:SynchronousScrollDataGrid x:Name="firstDataGrid"
                                                 Grid.Row="1"
                                                 Height="500"
                                                 AlternatingRowBackground="#FFF1F1F1"
                                                 AutoGenerateColumns="False"
                                                 IsReadOnly="True"
                                                 ItemsSource="{Binding ItemsList1}"
                                                 RowHeight="25"
                                                 SelectionMode="Single"
                                                 SynchronousScrollingDataGrid="{Binding ElementName=secondDataGrid}">

            <data:DataGrid.Columns>

                <data:DataGridTextColumn MinWidth="100"
                                         Binding="{Binding Item1}"
                                         CanUserSort="False"
                                         Header="Column 1" />

                <data:DataGridTextColumn MinWidth="100"
                                         Binding="{Binding Item2}"
                                         CanUserSort="False"
                                         Header="Column 2" />

                <data:DataGridTextColumn MinWidth="100"
                                         Binding="{Binding Item3}"
                                         CanUserSort="False"
                                         Header="Column 3" />

            </data:DataGrid.Columns>

        </Real_Controls:SynchronousScrollDataGrid>

        <Real_Controls:SynchronousScrollDataGrid x:Name="secondDataGrid"
                                                 Grid.Row="1"
                                                 Grid.Column="1"
                                                 Height="500"
                                                 AlternatingRowBackground="#FFF1F1F1"
                                                 AutoGenerateColumns="False"
                                                 ItemsSource="{Binding ItemsList2}"
                                                 RowHeight="25"
                                                 SelectionMode="Single"
                                                 SynchronousScrollingDataGrid="{Binding ElementName=firstDataGrid}">

            <data:DataGrid.Columns>
                <data:DataGridTextColumn MinWidth="100"
                                         Binding="{Binding Item1}"
                                         CanUserSort="False"
                                         Header="Column 4" />

                <data:DataGridTextColumn MinWidth="100"
                                         Binding="{Binding Item2}"
                                         CanUserSort="False"
                                         Header="Column 5" />

            </data:DataGrid.Columns>

        </Real_Controls:SynchronousScrollDataGrid>
    </Grid>
</UserControl>
